<template>
	<view>
		<view class="" v-if="recordList.length > 0">
			<uni-card v-for="(item,index) in recordList" :key="index">
				<view @click="navRouter(`/pages/tabbar/polling/Sleepy/sleepyDetai?tiringId=${item.tiringId}`)" class="record">
					<view class="record-address">
						{{item.elevatorName}}
			
					</view>
					<view class="record-state">
						{{item.tiringFloor}}
					</view>
					<view class="information">
						<!-- left -->
						<view class="information-left">
							<view class="record-time">
								困人状态:
								<text>{{item.tiringDuration || '暂无'}}</text>
							</view>
							<view class="record-time">
								确认时间:
								<text>{{item.completeTime || '暂无'}}</text>
							</view>
			
						</view>
					</view>
			
				</view>
			</uni-card>
		</view>
		<view v-else>
			<null-page></null-page>
		</view>
	</view>
</template>

<script>
	import polling from "@/serve/api/polling.js";
	import nullPage from '@/common/null.vue'
	export default {
		
			components:{
				nullPage
			},
		data() {
			return {
				// 内容
				recordList: [],

				pageNum: 1,
				getListFlag: true,
			}
		},
		onLoad(e) {
			this.getpollingList();
		},
		methods: {
			async getpollingList() {
				let parme = {
					pageNum: this.pageNum,
					pageSize: 10,
				}
				const res = await polling.myRescueList(parme)
				console.log(res)
				if (res.data.data.list.length < 10) {
					this.getListFlag = false;
				}

				this.recordList.push(...res.data.data.list)
			},
		},
		onReachBottom(e) {
			if (this.getListFlag) {
				this.pageNum = this.pageNum + 1;
				this.getpollingList();
			}

		}
	}
</script>

<style scoped>
	* {
		margin: 0;
		padding: 0;
	}

	page {
		width: 750rpx;
		background: #EFF2F5;
		overflow: hidden;
	}

	view {
		font-size: 28rpx;
		line-height: 1.8;

	}

	.uni-card {
		width: 670rpx;
		/* height: 280rpx; */
		border: none;
		background: #FFFFFF;
		box-shadow: 0rpx 10rpx 10rpx 0rpx rgba(52, 54, 61, 0.05);
		border-radius: 16rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		line-height: 280rpx;
		text-align: left;
	}

	.uni-icons {
		color: #3AC211;
	}

	.record {
		font-family: PingFang SC;
		font-weight: 400;

	}

	.record-address {
		font-size: 30rpx;
		color: #34363D;
		display: flex;
		justify-content: space-between;
		margin-bottom: 30rpx;
	}

	.record-address text {
		color: #017EFE;
	}

	.record-state {
		font-size: 30rpx;
		color: #017EFE;
	}

	/* 左右 信息*/
	.information {
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-wrap: nowrap;
	}

	.record-time {
		font-size: 24rpx;
		color: #989BA6;
	}

	.record-time text {
		margin-left: 15rpx;
		color: #34363D;
		word-spacing: 15rpx;
		letter-spacing: 1rpx;
	}
</style>
